home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7646 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  57 lines

  1. Path: hevanet.com!usenet
  2. From: Lefty@hevanet.com (Lefty)
  3. Newsgroups: comp.lang.c++
  4. Subject: Help!   C++ undef array problem
  5. Date: 24 Feb 1996 20:16:00 GMT
  6. Organization: Hevanet Communications
  7. Message-ID: <4gnrm0$gcq@vista.hevanet.com>
  8. NNTP-Posting-Host: ke-a7.hevanet.com
  9. X-Newsreader: WinVN 0.92.6
  10.  
  11. Help, I'm getting an undefined symbol 'n' error when compiling Sea.cpp (below). Error points to 
  12. int bx[n]  in Sea.h
  13.  
  14. Shouldn't the integer 3 in (*GetModule(),"fish",3) be passed to Sea.cpp and Sea.h 
  15.  
  16. //************************** Lefty.cpp ************************************************************
  17. #include <owl\applicat.h>
  18. #include <owl\framewin.h>
  19. #inclued <owl\dc.h>
  20. #include Sea.h
  21.  
  22. class Try : public TFrameWindow 
  23. {
  24.      public:
  25.     Try(TWindow *parent, const char far *title);
  26.      private:
  27.     Sea* Animation        
  28. }:
  29.     
  30. Try::Try(TWindow *parent, const char far *title) : TFrameWindow(parent, title)
  31. {
  32.     Animation = new Sea(*GetModule(),"fish",3);
  33. }
  34.  
  35.  
  36.  
  37. // *************************** Sea.h *****************************************************************
  38. class Sea                        {
  39.      public: 
  40.     Sea::Sea(HINSTANCE hInst, char far* name, int n);
  41.      private:
  42.     int bx[n];               };
  43.  
  44.  
  45.  
  46. // **************************** Sea.cpp **************************************************************
  47. #include <owl\applicat.h>
  48. #include <owl\framewin.h>
  49. #inclued <owl\dc.h>
  50. #include Sea.h
  51.  
  52. Sea::Sea(HINSTANCE hInst, char far* name, int n)
  53. {
  54.      for(int i=1;i<=n;i++)  {
  55.     bx[i]= 3            }
  56. }
  57.